package com.cl.pattern.memento.clone;


/**
 * @ClassName Client
 * @Description 客户端
 * @Author Small
 * @Date 2020/7/9 10:26
 * @Version 1.0
 **/
public class Client {
    public static void main(String[] args) {
        // 定义发起人
        Originator originator = new Originator();
        originator.setState("原始状态");
        System.out.println("原始状态：" + originator.getState());

        originator.createMemento();

        originator.setState("最新状态");
        System.out.println("最新状态：" + originator.getState());

        originator.restoreMemento();
        System.out.println("恢复后的状态：" + originator.getState());
    }
}
